using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace Pokemon
{
    /// <summary>
    /// This is a game component that implements IUpdateable.
    /// </summary>
    public abstract class Bullet : DrawableGameComponent
    {               
        protected static Game _game;

        protected static SpriteBatch _SpriteBatch;

        protected Unit _target;

        protected TimeSpan _timeSpan;

        protected Unit _owner;

        protected Vector2 _position;

        protected int _frameIndex;

        public Bullet(Game game, Unit owner, Unit target)
            : base(game)
        {            
            _owner = owner;
            _target = target;
            _timeSpan = TimeSpan.Zero;            
            _frameIndex = 0;
        }

        public override void Update(GameTime gameTime)
        {
            try
            {
                _target = _owner.Enemy;        
            }
            catch (Exception)
            {                
                throw;
            }
            
        }

        public static void AddGame(Game game)
        {
            _game = game;
        }

        public static void AddSpriteBatch(SpriteBatch spriteBatch)
        {
            _SpriteBatch = spriteBatch;
        }
    }
}
